package com.example.film.service;

import com.example.film.entity.TheaterWeekSell;
import com.example.film.mapper.TheaterWeekSellMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TheaterWeekSellServiceImpl implements TheaterWeekSellService{

    @Autowired
    private TheaterWeekSellMapper theaterWeekSellMapper;

    @Override
    public List<TheaterWeekSell> findTheaterWeekSell() {
        return theaterWeekSellMapper.findTheaterWeekSell();
    }

    @Override
    public List<TheaterWeekSell> findTheaterWeekSellInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return theaterWeekSellMapper.findTheaterWeekSellInfo(startIndex,pageSize);
    }

    @Override
    public List<TheaterWeekSell> findTheaterWeekSellByWeek(Integer week) {
        return theaterWeekSellMapper.findTheaterWeekSellByWeek(week);
    }
}
